package HLCode.ASM;

import HLCode.HLCustomFunction;
import HLCode.HLCustomFunction_H;
import HLCode.ASM.value.ASM_Int;

public class HLASM_ReturnInt implements HLIASM, HLCustomFunction_H {
    ASM_Int value = null;

    public int Load(byte[] data, int pos) {
        value = new ASM_Int();
        pos = value.Load(data, pos);

        return pos;
    }

    public void Adjust(int[] lineIndexList) {
    }

    public void Execute(HLCustomFunction ownerFunction) {
        if (ownerFunction.resultIndex >= 0) {
            ownerFunction.resultOwnerObject.SetInt(ownerFunction.resultIndex, value.GetValue(ownerFunction));
        }

        ownerFunction.curLineIndex = Integer.MAX_VALUE;
    }
}
